/**
  @file ctc_internal_port.h

  @author  Copyright (C) 2011 Centec Networks Inc.  All rights reserved.

  @date 2010-03-29

  @version v2.0

    This file contains all internal port related data structure, enum, macro and proto.
 */

#ifndef _CTC_INTERNAL_PORT_H
#define _CTC_INTERNAL_PORT_H
#ifdef __cplusplus
extern "C" {
#endif
/****************************************************************
 *
 * Header Files
 *
 ***************************************************************/

/****************************************************************
*
* Defines and Macros
*
****************************************************************/
/**
 @defgroup internal_port INTERNAL_PORT
 @{
*/

/**
 @brief  Define internal port usage type
*/
enum ctc_internal_port_type_e
{
    CTC_INTERNAL_PORT_TYPE_ILOOP,      /**< [GB.GG.D2.TM.TMM.AT] I-Loopback port */
    CTC_INTERNAL_PORT_TYPE_ELOOP,     /**< [GB.GG.D2.TM.TMM.AT] E-Loopback port */
    CTC_INTERNAL_PORT_TYPE_DISCARD,  /**< [GB.GG.D2.TM.TMM.AT] Discard port */
    CTC_INTERNAL_PORT_TYPE_FWD,        /**< [GB.GG.D2.TM.TMM.AT] Forwarding port, used for BPE */
    CTC_INTERNAL_PORT_TYPE_ILOOP_ELOOP, /**< GG.D2.TM.TMM.AT] I-Loopback and E-Loopback port */
    CTC_INTERNAL_PORT_TYPE_WLAN       /**< [D2.TM] WLAN port*/
    
};
typedef enum ctc_internal_port_type_e ctc_internal_port_type_t;

/**
 @brief Enum value used in internal port flag APIs
*/
enum ctc_internal_port_flag_e
{
    CTC_INTERNAL_PORT_FLAG_USE_LOGIC_DST_PORT    = (1 << 0), /**< [TMM] If set, means take logic dest port back to ipe from epe */
    CTC_INTERNAL_PORT_DONT_CARE_PP_ID            = (1 << 1)  /**< [AT] If set, means packet would loop back to the pp itself */
};
typedef enum ctc_internal_port_flag_e ctc_internal_port_flag_t;

/**
 @brief Internal port assign parameters.
*/
struct ctc_internal_port_assign_para_s
{
    ctc_internal_port_type_t type;                /**< [GB.GG.D2.TM.TMM.AT] internal port type */
    uint8  gchip;                                 /**< [GB.GG.D2.TM.TMM.AT] global chipId */
    uint8  slice_id;                              /**< [GG] slice Id for alloc CTC_INTERNAL_PORT_TYPE_ILOOP and CTC_INTERNAL_PORT_TYPE_ELOOP port */
    uint8  pp_id;                                 /**< [AT] Pipeline id, care pipeline id*/
    uint16 inter_port;                            /**< [GB.GG.D2.TM.TMM.AT] the internal port which is assigned or setted */
    uint32 fwd_gport;                             /**< [GB.GG.D2.TM.TMM.AT] this is the dest port of FWD type */
    uint32 nhid;                                  /**< [GB.GG.D2.TM.TMM.AT] Nexthop information for CTC_INTERNAL_PORT_TYPE_ELOOP */
    uint32 flag;                                  /**< [TMM] Refer to ctc_internal_port_flag_t */
};
typedef struct ctc_internal_port_assign_para_s ctc_internal_port_assign_para_t;

/**@} end of @defgroup internal_port INTERNAL_PORT  */

#ifdef __cplusplus
}
#endif

#endif

